<template>
  <div class="demo">
    <h2>学校信息</h2>
    <h4>校名：{{ schoolName }}</h4>
    <h4>地址：{{ schoolAddress }}</h4>
    <button @click="showSchoolInfo">点我提示学校信息</button>
  </div>
</template>

<script>
  export default {
    name: "School",
    data() {
      return {
        schoolName: "尚硅谷",
        schoolAddress: "宏福科技园",
      };
    },
    methods: {
      showSchoolInfo() {
        alert(`${this.schoolName}坐落于${this.schoolAddress}`);
      },
    },
  };
</script>

<style scoped>
  .demo {
    background-color: green;
    padding: 10px;
    box-shadow: 0 0 10px;
    border-radius: 10px;
  }
</style>